import Vue from 'vue'
import App from './views/ticket.vue'
import store from './store' // 数据仓库

import bgy from 'bgy'
Vue.use(bgy.install)

Vue.prototype.$store = store

switch (process.env.NODE_TYPE) {
  case 'test':
    Vue.prototype.$site = Vue.prototype.SERVER_TEST
    break
  case 'pre':
    Vue.prototype.$site = Vue.prototype.SERVER_PRE
    break
  case 'prod':
    Vue.prototype.$site = Vue.prototype.SERVER_PROD
    break
  default:
    Vue.prototype.$site = Vue.prototype.SERVER_TEST
    break
}
Vue.prototype.$setCookie('server', JSON.stringify(Vue.prototype.$site), {expires: 14, domain: Vue.prototype.$site.domain})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  store,
  template: '<App/>',
  components: { App }
})
